package com.tx.websocket.demo.dao;

import java.util.List;

import com.tx.websocket.demo.common.OffsetBean;
import com.tx.websocket.demo.model.User;
import com.tx.websocket.demo.model.UserRoleRel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;


@Mapper
public interface UserDao {

    Integer addUser(User user);

    List<User> listUser(@Param("user") User user, @Param("offsetBean") OffsetBean offsetBean);

    User getUserByPrimaryKey(@Param("id") Long id);

    Integer delUserByPrimaryKey(@Param("id") Long id);

    Integer updateUser(User user);

    User getUserByUsername(String username);

    Integer totalUser(@Param("user") User user);

    Integer delUserRoleById(Long userId);

    Integer insertUserRole(List<UserRoleRel> userRoleRels);
}
